package com.googlecode.wmlynar.gwtbeans.client.beans;

/**
 * Interface providing access to properties of the bean.
 * 
 * @author Wojciech Mlynarczyk (wmlynar@gmail.com)
 * 
 * @param <T>
 *            Type of the object containing the property.
 * @param <V>
 *            Type of the property.
 */
public interface Property<T, V> {

    /**
     * Returns the value of the property for given object.
     * 
     * @param o
     *            Object holding the property.
     * @return Actual value of the property.
     */
    V getValue(T o);

    /**
     * Sets new value of the property for given object.
     * 
     * @param o
     *            Object holding the property.
     * @param value
     *            New value of the property.
     */
    void setValue(T o, V value);

    /**
     * @return Name of the property.
     */
    String getName();

}
